nwn2fandomcom-20200214-history
Waypoints used with walkwaypoints
category:Script_directory:Area/Dynamic Creation/Transportation Waypoints Used With Walkwaypoints There are 4 different types of waypoint to get your NPC to move around in a set pattern via the standard Bioware Waypoint system. WP_ , WN_ , POST_ , NIGHT_ Each waypoint has a prefix (as shown above) followed by the TAG of the NPC. So if your NPC had a tag of SMITH then the waypoint tags would be, WP_SMITH, WN_SMITH, POST_SMITH, NIGHT_SMITH WP_ Waypoints: These waypoints are used to move your NPC around in the day. WN_ Waypoints: These waypoints are used to move your NPC around at night. POST_ Waypoints: Used to make your NPC walk to one spot and stay there at daytime. NIGHT_ Waypoints: Used to make your NPC walk to one spot and stay there at nighttime. The NPC can have multiples of the WP_ and WN_ waypoints, but only one POST_ and one NIGHT_ waypoint. Multiples of the WP and WN waypoints have a sequence number at the end of the tag name, so for the NPC called SMITH, the waypoints would be; WP_SMITH_01, WP_SMITH_02, WP_SMITH_03, etc.... The POST waypoint cannot be used with WP waypoints for a given NPC. The WP waypoints override POST waypoints. A similar rule applies to NIGHT waypoint not being used with WN waypoint WN waypoints override NIGHT waypoint. This means you cannot have the NPC run a set pattern of WP_ waypoints to then stand at a POST_ waypoint. The easiest way of getting the waypoints up and running for your npc is Right click on your npc and choose create waypoint. A waypoint is created underneath or near the npc. Move the mouse to the point on screen you want your second waypoint to appear, and then right click, the option to create a waypoint is given. Choosing create waypoint will create a second waypoint for your NPC. This process can be done multiple times. To get a guard to return to his barracks at night. If the guard has a tag of GUARD, then place a NIGHT_GUARD waypoint in the barracks. This can be used with a sequence of WP waypoints for your guard to patrol in the day, e.g. WP_GUARD_01, WP_GUARD_02, etc Or it can be used with a POST waypoint tagged POST_GUARD to have him stand at his post in the day. To allow for cross area transitions, e.g. Barracks in one area, patrol route in another. You will need to set the global int X2_SWITCH_CROSSAREA_WALKWAYPOINTS to one on the module. To do this; In module properties, click the advanced tab, then click variables. Enter X2_SWITCH_CROSSAREA_WALKWAYPOINTS as an int and the value to 1. My guard gets stuck crossing area transitions.(or is going a strange route) You will have to experiment with this, due to some issues with the pathfinding. If your area has more than one transition point to a second (but same) area then do not expect your NPC to use the transition point you want. It may be best to experiment using POST and NIGHT waypoints first to see which route the NPC favours. Its worth knowing this, so you know why its happening, and you don't waste too much time, like I have My NPC is getting stuck on walls. This is due to the AI on NPC's being set to low if a player is not in the area. One of the best ways to get around this is to have more WP, WN waypoints if you can to help the NPC pathfind a lot better. Obviously this won't help POST and NIGHT waypoints, but if you know scripting you could place a script on enter of an area to check if any players are in the area and if not, jump the NPC to its POST or NIGHT waypoint. My NPC is not facing the same direction as his waypoint when at a POST or NIGHT waypoint. Right-click the Waypoint and go to variables. Enter X2_L_WAYPOINT_SETFACING as an int and the value to 1. My NPC is not changing to its NIGHT_ or WN waypoints at night time. Ensure that in the onspawn script of your NPC, the following line is uncommented (e.g. the // removed before it, and the line not displayed in green) SetSpawnInCondition (NW_FLAG_DAY_NIGHT_POSTING); My NPC doesn't seem to want to walk to their waypoints In the onspawn script of your NPC ensure that following two lines are still commented out (e.g. the // is still before the lines, and the line is displayed green) SetSpawnInCondition (NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); SetSpawnInCondition (NW_FLAG_AMBIENT_ANIMATIONS); Waypoints Used With Mobile Ambient Animations The following Waypoints require that mobile ambient animations be switched on at spawn time of the NPC. That means that the follwing line needs to be uncommented in the onspawn script. (e.g. the // removed before it, and the line not displayed in green) SetSpawnInCondition (NW_FLAG_AMBIENT_ANIMATIONS); When mobile ambient animations is switched on for a NPC, the NPC will wander around and interact with other NPC's that have either mobile or immobile ambient animations switched on. They will also interact with nearby placeables. walking up to a placeable, closing nearby doors. Also worth noting that the NPC's will also use the same animations for mobile ambient animations, as they do for immobile ambient animations (with a bit more moving around ). The NPC with mobile ambient animaions switched on will never wander too far from its spawn point(starting position), always returning back to it. The following waypoints allow for better control of your NPC's. To wander around more between the waypoints described below, aswell as the placeables the NPC comes across, or the other NPC's, or its spawn point(start position). Remember - The NPC's will not walk straight to these waypoints as in walkwaypoints above but will meander amongst them(wander about them in a casual laid back way). Generic Stop Waypoint This waypoint is tagged "NW_STOP". If you place a few of these in an area, lets say a city exterior for example. If the NPC's spawned in that area have mobile ambient animations switched on, they will walk amongst the NW_STOP waypoints. This works quite well if you want a busy/crowded city/town feel. So you could have a park area in the city with an NW_STOP waypoint, or/and a NW_STOP waypoint near a market stall. The NPC's spawned in that are will at some point in their wanderings go to these waypoints. Tavern Waypoint This waypoint is tagged "NW_TAVERN". If NPC's are spawned inside an area with the tavern waypoint, then those NPC's will remain in the tavern and not leave it. However, for NPC's spawned outside the tavern area, If you place a NW_STOP waypoint inside the tavern aswell (as the NW_TAVERN), The NPC's will cross the area transition to visit the NW_STOP waypoint in the Tavern, neatly closing the door behind them on entry/exit of the tavern/area outside. There has been a bit of a misconception regarding this waypoint, this waypoint does not make any new animations appear as far as I know by simply dropping it in a tavern. Only by setting the immobile or mobile animations on an NPC in the spawn script will the NPC move. Shop Waypoint This waypoint is tagged "NW_SHOP". Like the tavern waypoint, if an NPC is spawned inside an area with the shop waypoint then the NPC will remain in the shop and not leave it (the shop keeper/assistant I guess). if an NPC is spawned outside the shop area, If you place a NW_STOP waypoint inside the shop aswell, the NPC will cross the area transition to visit the NW_STOP waypoint, neatly closing the door behind them on entry/exit of the shop. Home waypoint This waypoint is tagged "NW_HOME". If an npc is spawned in an area that that has a home waypoint then the NPC will class that area as his home. what should happen is the NPC will leave the area in the day and return to it at night. After long testing, the NPC only seemed to want to leave the area if a player entered it, however the NPC did return back to the area at night. Safe Waypoint This waypoint is tagged "NW_SAFE". Placing one of these waypoints in area, means that any injured NPC with mobile animations will retreat to this point. Sort of like a cowering corner. NPC's will not cross area transitions to get to a NW_SAFE waypoint. If there is not a NW_SAFE waypoint in the same area then they will resume mobile animations. Stealth Waypoint This Waypoint is tagged "NW_STEALTH". Placing one of these waypoints in an area, means any NPC with stealth capabilities that reaches one of these waypoints, turns stealth mode on. Could be good for using in dark caverns/dungeons etc, to have NPC dissappear into and appear from the darkness. Detect waypoint Ok, I admit, this one I thought I'd leave you guys to figure out....... My NPC is not wandering around even though mobile animations is switched on. Ensure that the following line is commented out in the onspawn script of the NPC. (e.g. the // is still before the lines, and the line is displayed green) SetSpawnInCondition (NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); Can I use NW_STOP waypoints inside NW_TAVERN,NW_SHOP waypointed areas? The answer is yes. You will need to place NW_STOP waypoints in the NW_TAVERN,NW_SHOP areas if you want the NPC's outside to come and drink/shop Creature related waypoints As an extra, I thought I would throw this one in, I've done most of the others, so...... The following waypoint is used with the Bioware Beholder AI. Beholder AI exit waypoint This waypoint is tagged "X2_WP_BEHOLDER_TUNNEL" If you look in the script "x2_ai_behold" it tells you what the waypoint is for. It explains; Beholder will always use its eyes, unless a) If threatened in melee, it will try to move away or float away to the nearest waypoint tagged X2_WP_BEHOLDER_TUNNEL So if you place a few of these waypoints around, your beholder will escape to the nearest one. If you noticed in Chapter two of HotU these waypoints where placed on the otherside of room doors. (sneaky )